<div ng-controller="questionStoreCtrl">

    <h3 style = "display: inline-block;"><B>常用帖库管理</B></h3>

    <a class="btn btn-secondary" href="/#/questionStore/Add" style = "margin: -5px 0 0 20px;padding: 5px 8px;border-radius: 4px;">新增帖子</a>

    <form class="form-inline" role="form">
        <div class="form-group">
            <label class="control-label" for="textinput">关键字:</label>
            <input type="text" class="form-control" placeholder="" style="margin-left:0px;width: 280px"
                   ng-model="description">

            <button type="submit" id="btnSearch" class="form-control btn btn-secondary"
                    ng-click="getQuestionStoreList()">搜索
            </button>

        </div>
    </form>
    <br>
    <paging>
        <ul class="pagination" num-pages="tasks.pageCount" current-page="tasks.currentPage"
            on-select-page="selectPage(page)">
            <li ng-class="{disabled: noPrevious()}"><a ng-click="selectPrevious()">&laquo;</a>

            </li>
            <li ng-repeat="page in pages" ng-class="{active: isActive(page)}"><a
                    ng-click="selectPage(page)">{{page}}</a>

            </li>
            <li ng-class="{disabled: noNext()}"><a ng-click="selectNext()">&raquo;</a>

            </li>
            <li ng-show="currentPage>6"><a ng-click="selectPage(1)">首页</a>

            </li>
        </ul>
    </paging>
    <div class="tab-content" style="margin-top: 20px">
        <div class="tab-pane active" id="tab_b">
            <table class="table table-condensed">
                <thead>
                <tr>
                    <th>标签<!--status--></th>
                    <th>描述<!--desc--></th>
                    <!--<th>创建者&lt;!&ndash;createdBy&ndash;&gt;</th>-->
                    <th>创建时间<!--createdBy--></th>
                    <th>最后修改时间<!--dateLastModified--></th>
                    <th>分类</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="question in questionStoreList">

                    <!--<td><div style= "width: 90px;line-height: 1.2;">{{}}</div></td>-->
                    <td><div class = "ell" style = "display: table;width: 40px;white-space:normal;line-height: 1.2;"><div style = "display: table-cell;vertical-align: middle;"><span ng-repeat="t in question.tag">{{t.value}} </span></div></div></td>
                    <td style="width: 400px;word-wrap:break-word;"><div style = "position: relative;width: 400px;line-height: 1.2;">{{question.desc}}</div></td><!--onmouseover="hideContent(this)"-->
                    <td><div class = "ell" style = "width: 100px;line-height: 24px;">{{question.dateCreated | date:'yyyy-MM-dd'}}<br>{{question.dateCreated | date:'HH:mm:ss'}}</div></td>
                    <td><div class = "ell" style = "width: 100px;line-height: 24px;">{{question.dateLastModified | date:'yyyy-MM-dd'}}<br>{{question.dateLastModified | date:'HH:mm:ss'}}</div></td>
                    <!--<td style="width: 400px;word-wrap:break-word;"><div style = "position: relative;width: 400px;line-height: 1.2;">{{categoryList[question.category]}}</div></td>-->
                    <td>
                        <select ng-model="question.category" ng-options="c.value as c.name for c in categoryList">
                        </select>
                    </td>
                    <td width="350">
                        <div style = "margin: 0;padding: 0;width: 160px;line-height: 20px;" class = "button-control">
                            <a class="btn btn-default btn-xs" ng-click="gotoQuestionEditPage(question.objId)">编辑</a>
                            <a class="btn btn-secondary btn-xs" ng-click="deleteQuestion(question.objId)">删除</a>
                        </div>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>

</div>